<template>
	<div class="inner-content list-content">
		<div class="title">
			审核商品
		</div>
		<el-row>
		<el-table
		  :data="productList"
		  style="width: 100%">
		  <el-table-column
		    label="商品图片"
		    width="180">
		    <template scope='scope'>
		    	<img :src="scope.row.picUrl" alt="商品图片" width="160" height="160">
		    </template>
		  </el-table-column>
		  <el-table-column
		    prop="waterFactoryName"
		    label="水厂"
		    width="180">
		  </el-table-column>
		  <el-table-column
		    prop="brand"
		    label="品牌名">
		  </el-table-column>
		  <el-table-column
		    prop="name"
		    label="商品名">
		  </el-table-column>
		  <el-table-column
		    prop="standard"
		    label="规格">
		  </el-table-column>
		  <el-table-column
		    prop="disposable"
		    label="一次性用水">
		  </el-table-column>
		  <el-table-column
		    prop="prForWaSt"
		    label="水店报价（元）">
		  </el-table-column>
		  <el-table-column
		    label="操作">
		    <template scope='scope'>
		    	<el-button type='text' @click='receive(scope.row)'>通过</el-button>
		    	<el-button  type='text' @click='reject'>驳回</el-button>
		    </template>
		  </el-table-column>
		</el-table>
		</el-row>
		
		<div class="paging">
		  <el-pagination
		       @current-change='handleCurrentChange'
		       :current-page.sync='currentPage'
		       layout='prev, pager, next, jumper'
		       :total='total'
		       class='pagination'
		       v-show='total'>
		   </el-pagination>
		</div>

		<el-dialog title="完善信息" :visible.sync="receiveDialogShow">
			<el-form :model='receiveForm' :rules="rules" 
			label-width='120px' ref="receiveForm">
				<el-form-item label='水厂：'>
					<span>{{receiveForm.waterFactoryName}}</span>
				</el-form-item>
				<el-form-item label='品牌：'>
					<el-input v-model="receiveForm.brand"></el-input>
				</el-form-item>
				<el-form-item label='名字：'>
					<span>{{receiveForm.name}}</span>
				</el-form-item>
				<el-form-item label='规格：'>
					<span>{{receiveForm.standard}}</span>
				</el-form-item>
				<el-form-item label='水店价：'>
					<span>{{receiveForm.prForWaSt}}</span>
				</el-form-item>
				<el-form-item label='一次性用水：'>
					<span>{{receiveForm.disposable}}</span>
				</el-form-item>
				<el-form-item label='空桶价格：' prop='blBuPr'>
					<el-input v-model="receiveForm.blBuPr"></el-input>
				</el-form-item>
				<el-form-item label='售价：' prop='prForWaUs'>
					<el-input v-model="receiveForm.prForWaUs"></el-input>
				</el-form-item>
				<el-form-item label='出厂价：' prop='producerPrice'>
					<el-input v-model="receiveForm.producerPrice"></el-input>
				</el-form-item>
				<el-form-item label='配送提成：' prop='prForWaDe'>
					<el-input v-model="receiveForm.prForWaDe"></el-input>
				</el-form-item>
				<el-form-item class="receiveFormButton">
					<el-button @click="submitReceiveForm(receiveForm)">
						保存
					</el-button>
					<el-button @click="resetReceiveForm('receiveForm')">重置</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>

		<el-dialog title="驳回原因" 
		:visible.sync="rejectDialogShow">
			<el-form :model="rejectForm" :rules="rejectrules" label="120px" ref="rejectForm">
				<el-form-item label='反馈建议' prop='reason'>
					<el-input v-model="rejectForm.reason">
					</el-input>
				</el-form-item>
				<el-form-item class="rejectFormButton">
					<el-button @click="submitRejectForm(rejectForm)">
						提交
					</el-button>
					<el-button @click="resetRejectForm('rejectForm')">
						重置
					</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>
	</div>
</template>
<script>
    import CheckJs from './Check.js';
    module.exports = CheckJs;
</script>

<style scoped lang='less'>
    @import url(Check.less);
</style>